package com.gupaoedu.starter;

import com.gupaoedu.starter.autoconfiguration.HelloPropertes;
import com.gupaoedu.starter.format.FormatProcessor;

/**
 * <p>
 *
 * </p>
 *
 * @author Nicky
 * @since 2019-07-13
 */
public class HelloFormatTemplate {

    private FormatProcessor formatProcessor;

    private HelloPropertes helloPropertes;


    public HelloFormatTemplate(FormatProcessor formatProcessor,HelloPropertes helloPropertes){
        this.helloPropertes = helloPropertes;
        this.formatProcessor = formatProcessor;
    }

    public <T> String doFormat(T object){
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append("Begin Excute Format ").append("</br>");
        stringBuilder.append("HelloPropertes:").append(formatProcessor.format(this.helloPropertes.getInfo())).append("</br>");
        stringBuilder.append("obj Format reusult:").append(formatProcessor.format(object)).append("</br>");
        return  stringBuilder.toString();
    }
}
